<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<div class="general-options-panel" fxLayout="column">
    <span class="general-options-header">Value Transformation</span>
    <sp-ep-settings-section
        sectionTitle="Timestamp conversion"
        sectionDescription="Formula to convert the field value to a UNIX timestamp in milliseconds"
        fxLayout="column"
        fxFlex="100"
        *ngIf="isTimestampProperty"
    >
        <sp-edit-timestamp-property
            [cachedProperty]="cachedProperty"
            showEditTimestampProperty="!isTimestampProperty"
        >
        </sp-edit-timestamp-property>
    </sp-ep-settings-section>
    <sp-ep-settings-section
        sectionTitle="Value conversion"
        sectionDescription="Converts the original field values using the provided formula"
        fxLayout="column"
        fxFlex="100"
        *ngIf="isNumericProperty && !isTimestampProperty"
    >
        <sp-edit-correction-value [cachedProperty]="cachedProperty">
        </sp-edit-correction-value>
    </sp-ep-settings-section>
    <sp-ep-settings-section
        sectionTitle="Static value assignment"
        sectionDescription="Assigns a static value to each incoming event"
        fxLayout="column"
        fxFlex="100"
        *ngIf="addedByUser"
    >
        <mat-form-field class="w-100" fxFlex="100">
            <input
                matInput
                placeholder="Static Value"
                name="static_value"
                id="static_value"
                data-cy="connect-edit-field-static-value"
                [ngModel]="staticValue"
                (ngModelChange)="applyStaticValue($event)"
            />
        </mat-form-field>
    </sp-ep-settings-section>
    <sp-ep-settings-section
        sectionTitle="Regex Value Transformation"
        sectionDescription="Transforms the original field values using the provided regex"
        fxLayout="column"
        fxFlex="100"
        *ngIf="isStringProperty"
    >
        <sp-edit-regex-transformation [cachedProperty]="cachedProperty">
        </sp-edit-regex-transformation>
    </sp-ep-settings-section>
</div>
